function bar() {
  console.log(myName);
}

function foo() {
  var myName = '涛哥'
  bar()
}

var myName = '万总'

foo()